<template>
  <div class="home">
    
    <!-- {{$store.state.list}}
    <button @click="reduce" >---</button>
    <button @click="init" >点击获取异步数据</button> -->
     <h3>HOME {{$store.state.num}} </h3>
     <button @click="add">+++</button>
    
  </div>
</template>

<script>
// @ is an alias to /src 


export default {
  name:"Home",      
  
  methods: {
    add() {
        this.$store.commit("ADD_NUM")
    },
     reduce() {
   
    },
    init() {
      // actions this.$store.dispatch("函数名称")
      console.log(12);
      this.$store.dispatch('init')

    }
  }
}
</script>
